from langdev_helper.util.url import *
from langdev_helper.prompt.summary import *
from langdev_helper.prompt.rag import *
from langdev_core.llms.qianfan import call_llm
from langchain_core.prompts import PromptTemplate

test_url = "https://cn.vuejs.org/guide/quick-start.html"
docs = load_url(test_url)

# print(docs)
# print(prompt_summary)

prompt_template = PromptTemplate.from_template(prompt_summary)
pt = prompt_template.format(number=100, content=docs)

# res = call_llm(pt)
# print(res)

prompt_template = PromptTemplate.from_template(rag_prompt)

q = "创建一个使用全局构建版本的 Vue 应用,给出代码即可"
pt = prompt_template.format(context=docs, question=q)

res = call_llm(pt)
print(res)
